   //分享到微信的二维码
   var shareToWx = function () {
        var path = window.location.href;
        $("#qrcode-wx-img").qrcode({
            text: path, //设置二维码内容
            render: "table", //设置渲染方式
            width: 180, //设置宽度,默认生成的二维码大小是 256×256
            height: 180, //设置高度
            typeNumber: -1, //计算模式
            background: "#ffffff", //背景颜色
            foreground: "#000000" //前景颜色
        })
   }

   // 分享到qq
    var sharetoqq = sharetoqq = function(title, url, picurl) {
        var shareqqstring = 'https://connect.qq.com/widget/shareqq/index.html?title' + title + '&url=' + url + '&pics=' + picurl
        window.open(shareqqstring)
    }
   // 分享到新浪微博
    var sharetosina = function(title, url, picurl) {
        var sharesinastring = 'http://v.t.sina.com.cn/share/share.php?title=' + title + '&url=' + url + '&content=utf-8&sourceUrl=' + url + '&pic=' + picurl
        window.open(sharesinastring)
    }

    $("#share-weibo").click(function() {
        sharetosina(document.title, window.location.href, "")
    })

    $("#share-qq").click(function() {
        sharetoqq(document.title, window.location.href, "")
    })

    $("#share-wx").click(function() {
        document.getElementById('qrcode-wx-img').innerHTML = ''
        document.getElementById('qrcode-wx').style.display = 'block'
        shareToWx()
    })

    $('#qrcode-wx .close').click(function() {
        document.getElementById('qrcode-wx').style.display = 'none'
    })

    if ($("#share-weibo-1")) {
        $("#share-weibo-1").click(function() {
            sharetosina(document.title, window.location.href, "")
        })
    
        $("#share-qq-1").click(function() {
            sharetoqq(document.title, window.location.href, "")
        })
    
        $("#share-wx-1").click(function() {
            document.getElementById('qrcode-wx-img').innerHTML = ''
            document.getElementById('qrcode-wx').style.display = 'block'
            shareToWx()
        })
    }